const allowedPM = 'npm'
const currentPM = process.env.npm_execpath?.includes('npm-cli.js')
  ? 'npm'
  : process.env.npm_execpath?.includes('yarn')
    ? 'yarn'
    : process.env.npm_execpath?.includes('pnpm')
      ? 'pnpm'
      : 'unknown'

if (currentPM !== allowedPM) {
  console.error(
    `\x1b[31mThis repository requires using ${allowedPM} as the package manager.\n` +
      `Do not use ${currentPM}.\x1b[0m\n`
  )
  process.exit(1)
}
